#include<stdio.h>
#include<string.h>
int main()
{
	int a[10],b[100000]={0},len,i,j=0,n=0,x,y;
	int A,N,temp;
	//memset(b,0,sizeof(b));
	scanf("%d%d",&A,&N);
	if(N==0)
		printf("0\n");
	else
	{
		for(i=N;i>=1;i--)
		{
			b[j]=A*i+n;
			n=b[j]/10;
			b[j]%=10;
			j++;
		}
		j--;
		if(b[j]>=10)
			for(temp=b[j];temp>0;temp/=10)
				b[j++]=temp%10;
		for(i=j;i>=0;i--)
			printf("%d",b[i]);
		printf("\n");
	}
	return 0;
}
